using System.Windows;
using System.Windows.Browser;

namespace MoonRainbow.Input.Mouse
{
    internal class KeyboardFix
    {
        public KeyboardFix()
        {
            HtmlPage.Document.Body.AttachEvent("keydown", KeyDown);
            HtmlPage.Document.Body.AttachEvent("keyup", KeyUp);
        }

        private static void KeyDown(object sender, HtmlEventArgs e)
        {
            Application.Current.RootVisual.IsHitTestVisible = true;
        }

        private static void KeyUp(object sender, HtmlEventArgs e)
        {
            Application.Current.RootVisual.IsHitTestVisible = true;
        }
    }
}